import request from '@/router/axios';

export const getSnByOuterSn = (data) => {
  return request({
    url: '/api/mes-product/product/get-sequence-number-or-outer-sequence',
    method: 'post',
    data: data
  });
};

export const getWorkOrderInfo = (data) => {
  return request({
    url: '/api/mes-product/forward-trace/work-order-info',
    method: 'post',
    data: data
  });
};

export const getWorkOrderDetailInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/work-order-info/detail/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDeliveryInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/delivery-info/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getRepairInfoBySn = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query/trace-repair-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getAssociationInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/sn/relation-info/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getOverStationInfoBySn = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/sn/over-station/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getOverStationInfoByWorkOrderNo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/work-order/over-station/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getAssemblyParentInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/sn/assembly-parent-info/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getAssemblySonInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/sn/assembly-son-info/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getAccessoryInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward-trace-work-order-indirect',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getEquipmentInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward-trace-equipment',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getPackInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/sn/pack-info/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getInspectionInfo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward-trace-inspection',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getMachineTestInfo = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/sn/product-test/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getRepairInfoByWorkOrderNo = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward/work-order-no-trace-repair-info',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getWarehouseUsePart = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/warehouse-usage-material/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getAssemblyKeyMaterials = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward/trace-assemble-key-material',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getSMTUseMaterials = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward/trace-smt-material-usage',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDipUseMaterials = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/production-trace/page-query-forward/trace-dip-material-usage-section',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getUsageList = (current, size, params) => {
  return request({
    url: '/api/mes-product/forward-trace/material-usage-info/section/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getParamKey = (params) => {
  return request({
    url: '/api/blade-system/param/detail',
    method: 'get',
    params
  });
};

export const getSectionByWorkOrder = (data) => {
  return request({
    url: '/api/mes-product/work-order/list-section-by-work-order-no',
    method: 'post',
    data: data
  });
};

export const getTraceList = (current, size) => {
  return request({
    url: '/api/mes-product/work-section/trace-list',
    method: 'get',
    params: {
      current,
      size
    }
  });
};

export const getViewSettingList = (code) => {
  return request({
    url: `/api/mes-admin/page-element-config/list-by-code?code=${code}`,
    method: 'post'
  });
};
